//
// Created by Felix on 24-5-7.
//

#ifndef GAZE_USERUPDATESTATUSDTOVALIDATE_HPP
#define GAZE_USERUPDATESTATUSDTOVALIDATE_HPP

#include "service/UserService.hpp"

class UserUpdateStatusDtoValidate {
public:
    static bool validateRequireUserId(
            UserService &iUserService,
            const oatpp::Int32 &userId
    ) {
        if (userId <= 0) return false;
        auto user = iUserService.getUserById(userId);
        if (!user) return false;
        return true;
    }

    static bool validateRequireStatus(
            const oatpp::Object<UserUpdateStatusDto> &dto
    ) {
        switch (dto->status) {
            case 1:
            case 2:
                return true;
            default:
                return false;
        }
    }
};

#endif //GAZE_USERUPDATESTATUSDTOVALIDATE_HPP
